namespace Shumei.EFCore.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class gaga : DbMigration
    {
        public override void Up()
        {
            //DropForeignKey("dbo.News", "category_Id", "dbo.News_Category");
            //DropIndex("dbo.News", new[] { "category_Id" });
            RenameColumn(table: "dbo.News", name: "category_Id", newName: "News_CategoryId");
            AlterColumn("dbo.News", "News_CategoryId", c => c.Int(nullable: false));
            CreateIndex("dbo.News", "News_CategoryId");
            AddForeignKey("dbo.News", "News_CategoryId", "dbo.News_Category", "Id", cascadeDelete: true);
        }
        
        public override void Down()
        {
            //DropForeignKey("dbo.News", "News_CategoryId", "dbo.News_Category");
            //DropIndex("dbo.News", new[] { "News_CategoryId" });
            AlterColumn("dbo.News", "News_CategoryId", c => c.Int());
            RenameColumn(table: "dbo.News", name: "News_CategoryId", newName: "category_Id");
            CreateIndex("dbo.News", "category_Id");
            AddForeignKey("dbo.News", "category_Id", "dbo.News_Category", "Id");
        }
    }
}
